package 面试;

import java.util.Scanner;

public class 年月日求天数 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入年");
        int year = scanner.nextInt();
        System.out.println("请输入月");
        int month = scanner.nextInt();
        System.out.println("请输入天");
        int day = scanner.nextInt();
        int sumDays = 0;
        int[] days = {31,28,31,30,31,30,31,31,30,31,30,31};
        if((year%4 == 0 && year%100 != 0 )|| year%400 == 0){
            days[1]++;
        }
        for (int i = 0; i < month-1; i++) {
            sumDays += days[i];
        }
        sumDays += day;

        System.out.println(sumDays);
    }
}
